/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package inc.veluvana.weatherforecaster;

import java.io.File;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;

/**
 *
 * @author victor
 */
public class GUI extends javax.swing.JFrame {

    /**
     * Creates new form GUI
     */
    /** For create order **/
    Order or;
    public GUI() {
        initComponents();
        jButton2.setEnabled(false);
        jLabel10.setText(0+"");
        jLabel11.setText(0+"");
        jLabel12.setText(0+"");
        jLabel13.setText(0+"");
        jLabel14.setText(0+"");
        jLabel15.setText(0+"");
        
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {

    jLabel8 = new javax.swing.JLabel();
    jLabel9 = new javax.swing.JLabel();
    jTextField1 = new javax.swing.JTextField();
    jTextField2 = new javax.swing.JTextField();
    jLabel16 = new javax.swing.JLabel();
    jLabel17 = new javax.swing.JLabel();
    jTextField3 = new javax.swing.JTextField();
    jTextField4 = new javax.swing.JTextField();
    jPanel2 = new javax.swing.JPanel();
    jSlider3 = new javax.swing.JSlider();
    jSlider2 = new javax.swing.JSlider();
    jSlider1 = new javax.swing.JSlider();
    jSlider4 = new javax.swing.JSlider();
    jSlider5 = new javax.swing.JSlider();
    jSlider6 = new javax.swing.JSlider();
    jLabel2 = new javax.swing.JLabel();
    jLabel4 = new javax.swing.JLabel();
    jLabel5 = new javax.swing.JLabel();
    jLabel3 = new javax.swing.JLabel();
    jLabel6 = new javax.swing.JLabel();
    jLabel7 = new javax.swing.JLabel();
    jLabel10 = new javax.swing.JLabel();
    jLabel11 = new javax.swing.JLabel();
    jLabel12 = new javax.swing.JLabel();
    jLabel15 = new javax.swing.JLabel();
    jLabel14 = new javax.swing.JLabel();
    jLabel13 = new javax.swing.JLabel();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    menuBar = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    openMenuItem = new javax.swing.JMenuItem();
    exitMenuItem = new javax.swing.JMenuItem();
    helpMenu = new javax.swing.JMenu();
    aboutMenuItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    setTitle("Veluvana Inc");

    jLabel8.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel8.setText("Buyer's Name");

    jLabel9.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel9.setText("Address of Delivery");

    jTextField1.setName("BuyerTextField"); // NOI18N
    jTextField1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jTextField1ActionPerformed(evt);
      }
    });

    jTextField2.setToolTipText("");
    jTextField2.setName("addressFieldText"); // NOI18N

    jLabel16.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel16.setText("Delivery time");

    jLabel17.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel17.setText("Order Price");

    jTextField3.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jTextField3ActionPerformed(evt);
      }
    });

    jTextField4.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jTextField4ActionPerformed(evt);
      }
    });

    jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Select the amount of hardwood or sawdust "));

    jSlider3.setMaximum(1000);
    jSlider3.setValue(0);
    jSlider3.setName("JsliderCherry"); // NOI18N
    jSlider3.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider3StateChanged(evt);
      }
    });

    jSlider2.setMaximum(1000);
    jSlider2.setValue(0);
    jSlider2.setName("JsliderCurly"); // NOI18N
    jSlider2.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider2StateChanged(evt);
      }
    });

    jSlider1.setMaximum(1000);
    jSlider1.setValue(0);
    jSlider1.setName("JsliderGenuine"); // NOI18N
    jSlider1.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider1StateChanged(evt);
      }
    });

    jSlider4.setMaximum(1000);
    jSlider4.setToolTipText("");
    jSlider4.setValue(0);
    jSlider4.setName("JsliderWenge"); // NOI18N
    jSlider4.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider4StateChanged(evt);
      }
    });

    jSlider5.setMaximum(1000);
    jSlider5.setValue(0);
    jSlider5.setName("JsliderOak"); // NOI18N
    jSlider5.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider5StateChanged(evt);
      }
    });

    jSlider6.setMaximum(1000);
    jSlider6.setValue(0);
    jSlider6.setName("JsliderSawdust"); // NOI18N
    jSlider6.addChangeListener(new javax.swing.event.ChangeListener() {
      public void stateChanged(javax.swing.event.ChangeEvent evt) {
        jSlider6StateChanged(evt);
      }
    });

    jLabel2.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel2.setText("Cherry");

    jLabel4.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel4.setText("Genuine Mahogany");

    jLabel5.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel5.setText("Wenge");

    jLabel3.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel3.setText("Curly Maple");

    jLabel6.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel6.setText("White Oak");

    jLabel7.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel7.setText("Sawdust");

    jLabel10.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel10.setText("0");
    jLabel10.setName("lCherry"); // NOI18N

    jLabel11.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel11.setText("0");
    jLabel11.setName("lCurly"); // NOI18N

    jLabel12.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel12.setText("0");
    jLabel12.setName("lGenuine"); // NOI18N

    jLabel15.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel15.setText("0");
    jLabel15.setName("lSawdust"); // NOI18N

    jLabel14.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel14.setText("0");
    jLabel14.setName("lOak"); // NOI18N

    jLabel13.setFont(new java.awt.Font("Ubuntu", 1, 15)); // NOI18N
    jLabel13.setText("0");
    jLabel13.setName("lWenge"); // NOI18N

    javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
    jPanel2.setLayout(jPanel2Layout);
    jPanel2Layout.setHorizontalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel7)
          .addComponent(jLabel6)
          .addComponent(jLabel3)
          .addComponent(jLabel5)
          .addComponent(jLabel4)
          .addComponent(jLabel2))
        .addGap(34, 34, 34)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
          .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jSlider6, javax.swing.GroupLayout.PREFERRED_SIZE, 384, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 103, Short.MAX_VALUE)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
          .addComponent(jLabel10, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jLabel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jLabel15, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jLabel14, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jLabel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
          .addComponent(jLabel12, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        .addGap(80, 80, 80))
    );
    jPanel2Layout.setVerticalGroup(
      jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(jPanel2Layout.createSequentialGroup()
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jSlider3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel2)
          .addComponent(jLabel10))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel4)
          .addComponent(jSlider2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel11))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel5)
          .addComponent(jSlider1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel12))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel3)
          .addComponent(jSlider4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel13))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel6)
          .addComponent(jSlider5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel14))
        .addGap(6, 6, 6)
        .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addComponent(jLabel7)
          .addComponent(jSlider6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel15))
        .addGap(0, 15, Short.MAX_VALUE))
    );

    jLabel10.getAccessibleContext().setAccessibleName("lCherry");

    jButton1.setText("Create Order");
    jButton1.setName("btnOrder"); // NOI18N
    jButton1.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton1ActionPerformed(evt);
      }
    });

    jButton2.setText("Create PDF");
    jButton2.setName("btnPDF"); // NOI18N
    jButton2.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        jButton2ActionPerformed(evt);
      }
    });

    fileMenu.setMnemonic('f');
    fileMenu.setText("File");

    openMenuItem.setMnemonic('o');
    openMenuItem.setText("Open");
    openMenuItem.setName("openFile"); // NOI18N
    openMenuItem.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        openMenuItemActionPerformed(evt);
      }
    });
    fileMenu.add(openMenuItem);

    exitMenuItem.setMnemonic('x');
    exitMenuItem.setText("Exit");
    exitMenuItem.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        exitMenuItemActionPerformed(evt);
      }
    });
    fileMenu.add(exitMenuItem);

    menuBar.add(fileMenu);

    helpMenu.setMnemonic('h');
    helpMenu.setText("Help");

    aboutMenuItem.setMnemonic('a');
    aboutMenuItem.setText("About");
    aboutMenuItem.addActionListener(new java.awt.event.ActionListener() {
      public void actionPerformed(java.awt.event.ActionEvent evt) {
        aboutMenuItemActionPerformed(evt);
      }
    });
    helpMenu.add(aboutMenuItem);

    menuBar.add(helpMenu);

    setJMenuBar(menuBar);

    javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
    getContentPane().setLayout(layout);
    layout.setHorizontalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
          .addGroup(layout.createSequentialGroup()
            .addGap(24, 24, 24)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel8)
              .addComponent(jLabel9))
            .addGap(37, 37, 37)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
              .addComponent(jTextField2, javax.swing.GroupLayout.DEFAULT_SIZE, 230, Short.MAX_VALUE)
              .addComponent(jTextField1))
            .addGap(18, 18, 18)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jLabel16)
              .addComponent(jLabel17))
            .addGap(18, 18, 18)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addComponent(jTextField4)
              .addComponent(jTextField3)))
          .addGroup(layout.createSequentialGroup()
            .addGap(21, 21, 21)
            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
              .addGroup(layout.createSequentialGroup()
                .addComponent(jButton1, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(116, 116, 116)
                .addComponent(jButton2, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))
              .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
        .addGap(33, 33, 33))
    );
    layout.setVerticalGroup(
      layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
      .addGroup(layout.createSequentialGroup()
        .addContainerGap()
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel8)
          .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel16)
          .addComponent(jTextField3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addGap(18, 18, 18)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jLabel9)
          .addComponent(jTextField2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
          .addComponent(jLabel17)
          .addComponent(jTextField4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
        .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
          .addComponent(jButton1)
          .addComponent(jButton2))
        .addContainerGap(13, Short.MAX_VALUE))
    );

    pack();
  }// </editor-fold>//GEN-END:initComponents

    private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitMenuItemActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitMenuItemActionPerformed

    private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_openMenuItemActionPerformed
        // TODO add your handling code here:
        /** object for save order**/
        /**selected option **/
        int option;
        try{
        /**show file chooser **/
        JFileChooser chooser=new JFileChooser();
        option=chooser.showOpenDialog(this);
        if(option==JFileChooser.APPROVE_OPTION){
            
            /** file from file chooser **/
            File f = chooser.getSelectedFile();
            or.readFile(f.getAbsolutePath().toString());
            
            JOptionPane.showMessageDialog(this, "The file was load successfully");
              /**load data to GUI**/
                jTextField1.setText(or.getBuyerName().toString());
                jTextField2.setText(or.getDeliveryAddress().toString());
                jTextField3.setText(or.getDeliveryTime().toString());
                jTextField4.setText(or.getPurchasePrice().toString());
                /** Add logit to show values in sliderbar **/
                
                jButton2.setEnabled(true);
              
         }
        }catch(Exception e){
            e.printStackTrace();
        }
        
    }//GEN-LAST:event_openMenuItemActionPerformed

    private void aboutMenuItemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_aboutMenuItemActionPerformed
        // TODO add your handling code here:
        JOptionPane.showMessageDialog(this,"Create by Group I", "About", JOptionPane.INFORMATION_MESSAGE);

    }//GEN-LAST:event_aboutMenuItemActionPerformed

    private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField1ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField1ActionPerformed

    private void jSlider3StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider3StateChanged
        // TODO add your handling code here:
        int value=jSlider3.getValue();
        jLabel10.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider3StateChanged

    private void jSlider2StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider2StateChanged
        // TODO add your handling code here:
        int value=jSlider2.getValue();
        jLabel11.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider2StateChanged

    private void jSlider1StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider1StateChanged
        // TODO add your handling code here:
        int value=jSlider1.getValue();
        jLabel12.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider1StateChanged

    private void jSlider4StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider4StateChanged
        // TODO add your handling code here:
        int value=jSlider4.getValue();
        jLabel13.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider4StateChanged

    private void jSlider5StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider5StateChanged
        // TODO add your handling code here:
        int value=jSlider5.getValue();
        jLabel14.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider5StateChanged

    private void jSlider6StateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSlider6StateChanged
        // TODO add your handling code here:
        int value=jSlider6.getValue();
        jLabel15.setText(String.valueOf(value));
    }//GEN-LAST:event_jSlider6StateChanged

    private void jTextField3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField3ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField3ActionPerformed

    private void jTextField4ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextField4ActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_jTextField4ActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
        // TODO add your handling code here:
        //Create Order 
        or = new Order();
        or.setBuyerName(jTextField1.getText());
        or.setDeliveryAddress(jTextField2.getText());
        or.setDeliveryTime(jTextField3.getText());
        or.setPurchasePrice(jTextField4.getText());
        
        if(Integer.parseInt(jLabel10.getText())!=0){
            or.setAmount(Hardwood.getCHERRY(),Integer.parseInt(jLabel10.getText()) );
        }
         if(Integer.parseInt(jLabel11.getText())!=0){
            or.setAmount(Hardwood.getCURLY_MAPLE(),Integer.parseInt(jLabel11.getText()) );
        }
         if(Integer.parseInt(jLabel12.getText())!=0){
            or.setAmount(Hardwood.getGENUINE_MAHOGANY(),Integer.parseInt(jLabel12.getText()) );
        }
         if(Integer.parseInt(jLabel13.getText())!=0){
            or.setAmount(Hardwood.getWENGE(),Integer.parseInt(jLabel13.getText()) );
        }
         if(Integer.parseInt(jLabel14.getText())!=0){
            or.setAmount(Hardwood.getWHITE_OAK(),Integer.parseInt(jLabel14.getText()) );
        }
         if(Integer.parseInt(jLabel15.getText())!=0){
            or.setAmount(Hardwood.getSAWDUST(),Integer.parseInt(jLabel15.getText()) );
        }
       
         String type = ".wf";
         JFileChooser chooser = new JFileChooser();
         
         int selection = chooser.showSaveDialog(this);
         if(selection == JFileChooser.APPROVE_OPTION){
             File fichero = chooser.getSelectedFile();
             or.createFile(fichero.getAbsolutePath().toString());
         }
         
         
      JOptionPane.showMessageDialog(this,"The Order was create sucessfully, you can create PDF now");
      jButton2.setEnabled(true);
        
    }//GEN-LAST:event_jButton1ActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // TODO add your handling code here:
        //generate a pdf file
        PdfGenerator gen=new PdfGenerator();
        String msg;
        try{
            if(or!=null){
                msg=gen.principal(or).toString();
                JOptionPane.showMessageDialog(this, msg);
            }
            
        }catch(Exception e){
            e.printStackTrace();
        }
    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(GUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new GUI().setVisible(true);
            }
        });
    }
  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JMenuItem aboutMenuItem;
  private javax.swing.JMenuItem exitMenuItem;
  private javax.swing.JMenu fileMenu;
  private javax.swing.JMenu helpMenu;
  private javax.swing.JButton jButton1;
  private javax.swing.JButton jButton2;
  private javax.swing.JLabel jLabel10;
  private javax.swing.JLabel jLabel11;
  private javax.swing.JLabel jLabel12;
  private javax.swing.JLabel jLabel13;
  private javax.swing.JLabel jLabel14;
  private javax.swing.JLabel jLabel15;
  private javax.swing.JLabel jLabel16;
  private javax.swing.JLabel jLabel17;
  private javax.swing.JLabel jLabel2;
  private javax.swing.JLabel jLabel3;
  private javax.swing.JLabel jLabel4;
  private javax.swing.JLabel jLabel5;
  private javax.swing.JLabel jLabel6;
  private javax.swing.JLabel jLabel7;
  private javax.swing.JLabel jLabel8;
  private javax.swing.JLabel jLabel9;
  private javax.swing.JPanel jPanel2;
  private javax.swing.JSlider jSlider1;
  private javax.swing.JSlider jSlider2;
  private javax.swing.JSlider jSlider3;
  private javax.swing.JSlider jSlider4;
  private javax.swing.JSlider jSlider5;
  private javax.swing.JSlider jSlider6;
  private javax.swing.JTextField jTextField1;
  private javax.swing.JTextField jTextField2;
  private javax.swing.JTextField jTextField3;
  private javax.swing.JTextField jTextField4;
  private javax.swing.JMenuBar menuBar;
  private javax.swing.JMenuItem openMenuItem;
  // End of variables declaration//GEN-END:variables
}
